// 2974. 最小数字游戏
class Solution {
public:
    vector<int> numberGame(vector<int>& nums) {
        // vector<int> ret;
        sort(nums.begin(), nums.end());
        for(int i = 0; i < nums.size(); i+=2)
        {
            swap(nums[i], nums[i+1]);
        }

        return nums;
    }
};

// 455. 分发饼干
class Solution {
public:
    int findContentChildren(vector<int>& g, vector<int>& s) {
        sort(g.begin(), g.end());
        sort(s.begin(), s.end());
        int ng = g.size(), ns = s.size(), ret = 0;
        int i = 0, j = 0;
        while(i < ng && j < ns)
        {
            if(s[j] >= g[i])
            {
                ret++;
                i++;
                j++;
            }
            else
            {
                j++;
            }
        }
        return ret;
    }
};